#!/usr/bin/php
<?php

define('CWD', dirname(__FILE__));

$html = '';
$result = fopen(CWD.'/output.csv', 'r');
while ($row = fgetcsv($result)) {
	$odd = array_pop($row);
	$html .= '
	<tr>
		<td>'.implode('</td>
		<td>', $row).'</td>
	</tr>
	<tr><td colspan="4">'.$odd.'</td></tr>'."\n";
}
fclose($result);

file_put_contents(CWD.'/output.html', '<table style="width: 800px;" border="1">'.$html.'</table>');
